<?php
/**
* Senguranca Helper for CakePHP
*
* Copyright 2011-2011 Diego Moreno
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
*
* @author Diego Moreno
* @copyright 2011 Diego Moreno
* @link http://www.diegomoreno.com.br More Information
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
*/

class SegurancaHelper extends Helper {

    /**
     * @desc Retorna se possivel acessar funcionalidade do sistema
     * @param string $controller
     * @param string $action
     * @param array $security
     * @return string 
     */
    function verificar($controller, $action, $security){
        $url_add = '/'.$controller.'/'.$action;
        $desabilitado = '';
        if( !is_int(array_search($url_add,$security))){
            $desabilitado = 'disabled';
        }
        return $desabilitado;
    }

}

?>
